let ajaxTime = 0;

export default {
    // 基准路径
    baseURL:"https://api-hmugo-web.itheima.net/api/public/v1",
    async get(options) {
       try {
        ajaxTime++
        uni.showLoading({title:"加载中"})
 
        const res = await uni.request({
            ...options,
            url: this.baseURL + options.url
        })
         ajaxTime--;
         if (ajaxTime === 0) {
             uni.hideLoading()
         }
         return res[1].data.message  
       } catch (error) {
           console.log(error);
           uni.showToast({
               title:"请联系工作人员"
           })
       }
    },
    post() {
        
    }
}